
import i18n from '../../lang'
export default {
  shortcuts: [
    {
      text: i18n.t('zuoTian'),
      onClick(picker) {
        const end = new Date()
        const start = new Date()
        start.setTime(start.getTime() - 3600 * 1000 * 24)
        picker.$emit('pick', [start, start])
      }
    },
    {
      text: i18n.t('zuiJinQiTian'),
      onClick(picker) {
        const end = new Date()
        const start = new Date()
        start.setTime(start.getTime() - 3600 * 1000 * 24 * 6)
        picker.$emit('pick', [start, end])
      }
    },
    {
      text: i18n.t('benYue'),
      onClick(picker) {
        const end = new Date()
        const start = new Date()
        start.setTime(start.setTime(new Date(new Date().getFullYear(), new Date().getMonth(), 1)))
        picker.$emit('pick', [start, end])
      }
    },
    {
      text: i18n.t('zuiJin_30Tian'),
      onClick(picker) {
        const end = new Date()
        const start = new Date()
        start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
        picker.$emit('pick', [start, end])
      }
    },
    {
      text: i18n.t('zuiJinYiNian'),
      onClick(picker) {
        const end = new Date()
        const start = new Date()
        start.setTime(start.getTime() - 3600 * 1000 * 24 * 365)
        picker.$emit('pick', [start, end])
      }
    }
  ]
  // disabledDate(time) {
  //   let curDate = (new Date()).getTime();
  //   let three = 365 * 24 * 3600 * 1000;
  //   let threeMonths = curDate - three;
  //   return time.getTime() > Date.now() || time.getTime() < threeMonths;;
  // }
}
